package com.devunion.bogdan.view.actions;

import com.devunion.bogdan.util.IconHelper;
import com.devunion.bogdan.model.project.ProjectManager;
import com.devunion.bogdan.model.project.ProjectSavingException;

import javax.swing.*;
import java.awt.event.ActionEvent;

import org.apache.log4j.Logger;


/**
 * User: Leska
 * Date: 23.10.2004
 * Time: 23:51:38
 */
public class ProjectSaveAction extends AbstractAction {
    private static Logger log = Logger.getLogger(ProjectSaveAction.class);

    public ProjectSaveAction() {
        super(null, IconHelper.getIcon("SaveProject16.gif"));
        putValue(Action.LARGE_ICON_KEY, IconHelper.getIcon("SaveProject48.gif"));
    }

    public void actionPerformed(ActionEvent actionEvent) {
        try {
            ProjectManager.getInstance().saveCurrentProject();
        } catch (ProjectSavingException e) {
            log.error(e.getMessage(), e);
        }
    }
}